﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<NxPartyAffairsOpen.Models.InformationListModel>" %>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">

    <script type="text/javascript" src="<%=Url.Content("~/Scripts/jquery.pagination.js?fdfd") %>"></script>

    <script type="text/javascript" src="<%=Url.Content("~/DatePicker/WdatePicker.js") %>"></script>

    <script type="text/javascript">
        function pSCb(page_index, jq) {
            var url = location.href;
            if (gup('pi', location.href) == '') {
                if (url.indexOf('?') == -1) {
                    url += '?' + 'pi=' + page_index;
                }
                else {
                    url += '&' + 'pi=' + page_index;
                }
            }
            else {
                url = location.href.replace('pi=' + gup('pi', location.href), 'pi=' + page_index);
            }
            location.href = url;
            return false;
        }
        function changYear() {
            var url = location.href;
            var index = location.href.indexOf('?');
            if (index != -1)
                url = url.substring(0, index);
            url += '?';
            if (gup('categoryid', location.href) != '') {
                url += 'categoryid=' + gup('categoryid', location.href);
            }
            url += '&year=' + $("#txtYear").val();
            location.href = url;
            return false;
        }
        function gup(name, url) {
            name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
            var regexS = "[\\?&]" + name + "=([^&#]*)";
            var regex = new RegExp(regexS);
            var results = regex.exec(url);
            if (results == null)
                return "";
            else
                return results[1];
        }
        $(document).ready(function() {

            var initPagination = function() {
                var num_entries = '<%=Model.TotalCount %>';
                $("#divPager").pagination(num_entries, {
                    num_edge_entries: 1,
                    num_display_entries: 6,
                    callback: pSCb,
                    items_per_page: 14,
                    lang: 'zh-cn',
                    current_page: '<%=Model.PageIndex %>'
                });
            } ();
        });
      
       
    </script>

</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="List">
        <div class="Catogory">
            <div class="Header">
                <%=ViewData["DisplayName"] %>
            </div>
            <div class="Return">
                年份:<input type="text" class="TextBox02" style="width: 50px" readonly="readonly" onclick="WdatePicker({dateFmt:'yyyy',onpicked:function(){changYear();}})"
                    id="txtYear" name="txtYear" value="<%=Model.Year %>" />
                <a href="javascript:void(0);" onclick="javascript:window.history.go(-1);return false;">返回上一步</a>
            </div>
            <div class="MainInfolist">
                <ul>
                    <% 
                
                        foreach (NxPartyAffairsOpen.Models.InformationModel item in Model.InformationList)
                        {  %>
                    <li>
                        <%=Html.ActionLink(item.Title, "Details", "Home", new { @id = item.InfoGuid }, new { @title = item.Title,@target="_self"})%>
                        <span style="float: right; ">
                            <%=item.ShowTime.ToString("yyyy-MM-dd") %></span></li>
                    <%} %>
                </ul>
                <div class="pagination" id="divPager">
                </div>
            </div>
        </div>
    </div>
</asp:Content>
